/// @tags: DP on Tree
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>

using std::cin;
using std::cout;
using std::min;

namespace BlueQuantum {

constexpr int MAXN = 5e5 + 3, MAXD = 21, INF = 0x3f3f3f3f;

int n, d, m, ecnt;
int heads[MAXN];
int w[MAXN], f[MAXN][MAXD], g[MAXN][MAXD];

/// @brief as bool
int app[MAXN];

struct Edge {
  int v, nxt;
} e[MAXN * 2];

inline void add(int u, int v) { e[++ecnt].v = v, e[ecnt].nxt = heads[u], heads[u] = ecnt; }

void solve(int u, int fa) {
  f[u][0] = g[u][0] = app[u] ? w[u] : 0;
  for (int i = 1; i <= d; ++i) f[u][i] = w[u];
  for (int i = heads[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v != fa) {
      solve(v, u);
      for (int j = d; j >= 0; --j) {
        f[u][j] = min(f[u][j] + g[v][j], g[u][j + 1] + f[v][j + 1]);
      }
      for (int j = d; j >= 1; --j) {
        g[u][j] += g[v][j - 1];
      }
      for (int j = d - 1; j >= 0; --j) {
        f[u][j] = min(f[u][j], f[u][j + 1]);
      }
      g[u][0] = f[u][0];
      for (int j = 1; j <= d; ++j) {
        g[u][j] = min(g[u][j], g[u][j - 1]);
      }
    }
  }
}

inline int main() {
  cin >> n >> d;
  for (int i = 1; i <= n; ++i) {
    cin >> w[i];
  }
  cin >> m;
  for (int i = 1, x; i <= m; ++i) cin >> x, app[x] = true;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    add(u, v), add(v, u);
  }
  memset(f, INF, sizeof(f));
  solve(1, 1);
  int ans = INF;
  for (int i = 0; i <= d; ++i) ans = min(ans, f[1][i]);
  cout << ans;
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("P3267 [JLOI2016 SHOI2016] 侦察守卫.in", "r", stdin);
  freopen("P3267 [JLOI2016 SHOI2016] 侦察守卫.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
